# __author__ = 'heyin'
# __date__ = '2018/11/22 13:50'
import pandas as pd
import numpy as np

order = {'user_id': [1, 2, 3, 1, 2, 3, 3, 4, 2, 2],
         'wupin': ['水果', '家电', '水果', '水果', '办公', '办公', '日用', '日用', '蔬菜', '蔬菜']}

o = pd.DataFrame(order)
print(o)
ret = pd.crosstab(o['user_id'], o['wupin'])
print(ret)
